﻿Module core
    Public Declare Function WriteMemoryByte Lib "KERNEL32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 1, Optional ByRef BytesWritten As Integer = 0) As Byte
 
    Public Sub WriteMemoryASM(ByVal ProcessName As String, ByVal Address As Integer, ByVal Array As Byte())

        If Process.GetProcessesByName(ProcessName).Length = 0 Then
            Exit Sub
        End If
        Dim Handle As Integer = Process.GetProcessesByName(ProcessName)(0).Handle
        For Value As Byte = LBound(Array) To UBound(Array)
            WriteMemoryByte(Handle, Address + Value, Array(Value))
        Next
    End Sub
End Module
